<?php


namespace App\Model;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;

class LogLogin  extends Model {
    protected $table = 'log_login';
    protected $primaryKey = 'id';
    protected $dates = [
        'created_at',
        'updated_at',
    ];

    public static function add($uid,$ip=""){


            $insert['ip'] =$ip;
            $insert['uid']=$uid;
            $insert['create_at'] =date("Y-m-d H:i:s",time());
            $insert['update_at'] =date("Y-m-d H:i:s",time());
            return DB::table("log_login")->insertGetId($insert);
    }
}
